<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    let t = null;

    document.onmousemove = function(){
        if(t !== null) return;
        console.log("功能开启");        
        t = setTimeout(()=>{
            // ....
            console.log("被节流之后的功能");

            t = null;
        }, 500);
    }

</script>
</html>